<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Header</title>
    <!--== 网站图标 ==-->
    <!--<link rel="shortcut icon" type="image/x-icon" href="img/Favorites.ico" media="screen">-->
    <!--== 样式文件 ==-->
    <!--<link href="css/share.css" rel="stylesheet" type="text/css">-->
</head>
<body>

<!--==头部==-->
<div class="header-to">
    <div class="header-top">
        <!--导航-->
        <div class="header-top-nav">
            <h1>您好，欢迎来到芯佑电商平台</h1>
            <span>
                <a href="#">关于我们</a>
                <strong>|</strong>
                <a href="#">联系我们</a>
                <strong>|</strong>
                <a href="/website/personalData/me_data">个人资料</a>
                <strong>|</strong>
                <#if user?? && user!=''>
                    <a>已登录</a>
                <#else>
                    <a href="/website/login">登录</a>
                </#if>
                <strong>|</strong>
                <a href="/website/register">注册</a>
            </span>
        </div>
        <!--搜索-->
        <div class="header-top-search">
            <h1><a href="/website/home"><img src="/website/images/header.png"></a></h1>
            <span>
                <input type="text" id="parm" value="${condition}" placeholder="请输入关键字" >
                <button type="button" onclick="searchAll();">
                    <img src="/website/images/header_02.png">
                </button>s
            </span>
            <p><a href="/website/shoppingCart/shopping_list" id="shoppingCart"></a></p>
        </div>
    </div>
</div>

<!--==菜单==-->
<div class="header-men">
    <div class="header-menu">
        <ul>
            <li><a href="/website/home" class="hover">网站首页</a></li>
            <li><a href="/website/productList?page=1&limit=28">产品</a></li>
            <!--<li><a href="#">制造商</a><strong><img src="/website/images/header_05.png"></strong></li>
            <li><a href="#">半导体</a><strong><img src="/website/images/header_06.png"></strong></li>
            <li><a href="#">机电元件</a></li>
            <li><a href="#">无源元件</a></li>
            <li><a href="#">电源</a></li>
            <li><a href="#">传感器</a></li>
            <li><a href="#">数据存储器</a></li>-->
        </ul>
        <p>客服热线：<strong>400-0000-8888</strong></p>
    </div>
</div>
</body>
<script>
    function searchAll(){
        var parm = $("#parm").val();
        location.href="/website/product_search?condition="+parm;
    }
    $(function () {
        getCounts();
    })
    function getCounts(){
        $.ajax({
            url:"/website/shoppingCartCount",
            type:"get",
            success:function(resp){
                $("#shoppingCart").html("<img src=\"/website/images/header_03.png\">我的购物车("+resp.data+")");
            }
        })
    }
</script>
</html>